import {defineStore} from "pinia";
import {ref} from "vue";

export const useCommonStore = defineStore(
    "useCommonStore",
    () => {
        const commentItem = ref({})
        const addressItem = ref({})
        const goodsItem = ref([])
        return {commentItem,goodsItem,addressItem}
    },
    {
        // 配置持久化
        persist: {
            // 调整为兼容多端的API
            storage: {
                setItem(key, value) {
                    uni.setStorageSync(key, value) // [!code warning]
                },
                getItem(key) {
                    return uni.getStorageSync(key) // [!code warning]
                },
            },
        },
    }
)